<?php
	$ls_gridname	= 'detail_kontrak';


// ----------------- >> Form Detail << ----------------- ?>
<script type="text/javascript">
	$(document).ready(function(){

		// Setup Form
        $('#form_<?php echo $ls_gridname; ?>').setupForm([
        	{ name: 'id_detail_kontrak_pk', type: 'text' },
        	// { name: 'id_status_kontrak_fk', data:<?php echo json_encode(array_merge(array(array('value'=>'','display'=>'')),$listStatusKontrak)); ?> },
        	{ name: 'id_status_kontrak_fk', data:[{'value' : 'KP', 'display' : 'Kontrak Pekerjaan'}] },
        	{ name: 'tgl_mulai', type: 'date' },
        	{ name: 'tgl_selesai', type: 'date' },
        	{ name: 'ket_detail_kontrak', type: 'textarea', size:'long' }
        ], 
            <?php echo json_encode($data); ?>
        );

        // Set Hidden Object
		$('#id_detail_kontrak_pk').hide();

		// Cek Status Kontrak
		function cekKontrak(a) {
			if (a.toLowerCase() == "organik") {
				$('#tgl_selesai').readonly();
			} else {
				$('#tgl_selesai').readonly(false);
			}
		}

		var a = $("#id_status_kontrak_fk option:selected").text();
		cekKontrak(a);
		$( "#id_status_kontrak_fk" ).live( "click", function() {
			var a = $("#id_status_kontrak_fk option:selected").text();
			cekKontrak(a);
		});
		
	});
</script>
<div id="form_<?php echo $ls_gridname; ?>_container" style="padding:5px;width:100px;">
	<div id="form_<?php echo $ls_gridname; ?>">
    <table class="tb_form" border="0" cellpadding="0" cellspacing="0">
    	<tr>
	        <td class="label">Status Kontrak :</td>
	        <td class="label">Tanggal Mulai :</td>
	        <td class="label">Tanggal Selesai :</td>
	        <td class="label">No Kontrak :</td>
	    </tr>
	    <tr>
	    	<td><input id="id_detail_kontrak_pk" /><input id="id_status_kontrak_fk" /></td>
	    	<td><input id="tgl_mulai" /></td>
	    	<td><input id="tgl_selesai" /></td>
	    	<td><input id="ket_detail_kontrak" /></td>
	    </tr>
    </table>
	</div>
</div>
<?php 
